
#include "stdafx.h"
#include "CheckButton.h"
CheckButton::CheckButton()
:m_bChecked( FALSE )
{

}
CheckButton::~CheckButton()
{

}
void CheckButton::PaintWin(HDC hdcDst, RECT* prcWin, RECT* prcUpdate)
{
	UiButtonEx::PaintWin( hdcDst, prcWin, prcUpdate );
	int nCheckWidth = 60;	
	RECT rcCheck = *prcWin;
	rcCheck.left = rcCheck.right - nCheckWidth;
	if ( m_bChecked )
	{
		if (GetState()==MZCS_BUTTON_PRESSED)
		{
			MzDrawControl(hdcDst, &rcCheck, MZC_SELECTED, 0, false);
		}
		else
		{
			MzDrawControl(hdcDst, &rcCheck, MZC_SELECTED, 0, false);
		}
	}
	else
	{
		RECT rcCheck = *prcWin;
		rcCheck.left = rcCheck.right - nCheckWidth;
		MzDrawControl(hdcDst, &rcCheck, MZC_UNSELECTED, 0, false);
	
	}

}
void CheckButton::SetChecked( BOOL bChecked /* = FALSE */ )
{
	m_bChecked = bChecked;
}
BOOL CheckButton::IsChecked()
{
	return m_bChecked;
}

